
<template>
  <div class="box">
    <div class="content">
      <input type="text" placeholder="账号" v-model="user" />
      <input type="password" placeholder="密码" v-model="pws" />
      <!-- <van-button type="primary">主要按钮</van-button> -->
      <button @click="submit">立即登录</button>
    </div>
  </div>
</template>
 
<script>
import Vue from "vue";
import { Toast } from "vant";

Vue.use(Toast);
import { GetLoginList } from "../request/aip";
export default {
  data() {
    return {
      user: "",
      pws: "",
    };
  },
  methods: {
    submit() {
      if (true) {
        GetLoginList({
          username: "13559000000",
          password: "111111",
        }).then((res) => {
          // console.log(res);
          localStorage.setItem("x-auth-token", res.data);
          this.$router.push("/index");
        });
      } else {
        Toast("账号或者密码不能为空");
      }
    },
  },
};
</script>
 
<style lang = "less" scoped>
.box {
  width: 100vw;
  height: 100vh;
  background: url("../assets/login.jpg") center no-repeat;
  background-size: 100% 100%;
  overflow: hidden;
  .content {
    width: 100%;
    height: 40%;
    /* background-color: #cfc; */
    margin-top: 50vh;
    box-sizing: border-box;

    input {
      display: block;
      width: 50%;
      margin: auto;
      border: 1px solid black;
      border-radius: 20px;
      padding: 8px;
      padding-left: 1em;
      background-color: #ffcc33;
      margin-bottom: 10px;
      box-sizing: border-box;
      outline: none;
    }
    button {
      display: block;
      width: 30%;
      margin: auto;
      padding: 8px;
      background-color: #4366fe;
      color: #fff;
      border-radius: 22px;
      margin-top: 96px;
      box-sizing: border-box;
    }
  }
}
::-webkit-input-placeholder {
  /* Chrome/Opera/Safari */
  color: black;
  font-weight: 700;
}
</style>